# !/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName : code06.py
# @Time     : 2024/4/6 22:37
# @Author   : Robot-Zsj
"""
description:

input
1-2abcd
1-2abs1-2*3+7dd4-5+6

output
-1
2
"""
s = input()

ans = 0
mx = 0


def check(s):
    return not any(all(x in "*-+" for x in s[i:i + 3]) for i in range(len(s) - 2))


def evaluate_expression(expr):
    try:
        return eval(expr)
    except:
        return None


for i in range(len(s)):
    for j in range(i + mx, len(s)):
        if check(s[i:j + 1]):
            expr_value = evaluate_expression(s[i:j + 1])
            if expr_value is not None:
                ans = expr_value
                mx = j - i + 1
print(ans)
